package com.ktgj.flight.service.impl;

import java.util.List;

import com.ktgj.flight.domain.FlightOrderIternaryDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ktgj.flight.mapper.FlightDeliverAssignMapper;
import com.ktgj.flight.domain.FlightDeliverAssign;
import com.ktgj.flight.service.IFlightDeliverAssignService;

/**
 * 机票行程单配送Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-06-28
 */
@Service
public class FlightDeliverAssignServiceImpl implements IFlightDeliverAssignService 
{
    @Autowired
    private FlightDeliverAssignMapper flightDeliverAssignMapper;

    /**
     * 查询机票行程单配送
     * 
     * @param assignId 机票行程单配送ID
     * @return 机票行程单配送
     */
    @Override
    public FlightDeliverAssign selectFlightDeliverAssignById(Long assignId)
    {
        return flightDeliverAssignMapper.selectFlightDeliverAssignById(assignId);
    }

    /**
     * 查询机票行程单配送列表
     * 
     * @param flightDeliverAssign 机票行程单配送
     * @return 机票行程单配送
     */
    @Override
    public List<FlightDeliverAssign> selectFlightDeliverAssignList(FlightDeliverAssign flightDeliverAssign)
    {
        return flightDeliverAssignMapper.selectFlightDeliverAssignList(flightDeliverAssign);
    }

    /**
     * 新增机票行程单配送
     * 
     * @param flightDeliverAssign 机票行程单配送
     * @return 结果
     */
    @Override
    public int insertFlightDeliverAssign(FlightDeliverAssign flightDeliverAssign)
    {
        return flightDeliverAssignMapper.insertFlightDeliverAssign(flightDeliverAssign);
    }

    /**
     * 修改机票行程单配送
     * 
     * @param flightDeliverAssign 机票行程单配送
     * @return 结果
     */
    @Override
    public int updateFlightDeliverAssign(FlightDeliverAssign flightDeliverAssign)
    {
        return flightDeliverAssignMapper.updateFlightDeliverAssign(flightDeliverAssign);
    }

    /**
     * 批量删除机票行程单配送
     * 
     * @param assignIds 需要删除的机票行程单配送ID
     * @return 结果
     */
    @Override
    public int deleteFlightDeliverAssignByIds(Long[] assignIds)
    {
        return flightDeliverAssignMapper.deleteFlightDeliverAssignByIds(assignIds);
    }

    /**
     * 删除机票行程单配送信息
     * 
     * @param assignId 机票行程单配送ID
     * @return 结果
     */
    @Override
    public int deleteFlightDeliverAssignById(Long assignId)
    {
        return flightDeliverAssignMapper.deleteFlightDeliverAssignById(assignId);
    }

    //新增机票行程单
    @Override
    public int insertFlightDeliverAssign(String orderId) {
        FlightDeliverAssign deliverAssign = new FlightDeliverAssign();
        deliverAssign.setOrderId(Long.valueOf(orderId));
        return this.insertFlightDeliverAssign(deliverAssign);
    }

    //根据机票订单号回填快递单号
    @Override
    public int updateDeliverAssignByOrderId(FlightOrderIternaryDTO iternaryDTO) {
        return flightDeliverAssignMapper.updateDeliverAssignByOrderId(iternaryDTO);
    }
}
